package com.why.Test;

import com.why.client.NettyRpcClient;
import com.why.client.ProxyClient;

import com.why.loadbalance.RoundRobinLoadBalancer;
import com.why.nacos.DefaultNacosServiceRegistry;
import com.why.serializable.KroSerializer;
import com.why.testapi.HelloWorld;
import com.why.testbean.User;

public class TestClient {
    public static void main(String[] args) {
//      for(int i=0;i<10;i++){
           NettyRpcClient client = new NettyRpcClient( new DefaultNacosServiceRegistry(new RoundRobinLoadBalancer()),new KroSerializer());
           ProxyClient proxyClient = new ProxyClient(client);
           HelloWorld proxy = (HelloWorld) proxyClient.getProxy(HelloWorld.class);
           User user = new User("why", Integer.MAX_VALUE);
           proxy.sayHelloWorld(user);

//       }
    }
}